<?php
$http = new \Swoole\Http\Server('0.0.0.0','6064');

$http->set(
    [
        'enable_static_handler'=>true,
//        'document_root'=>'/wwwdata/web',
        'document_root'=>'/wwwdata/webSocket',
//        'daemonize' => 1
    ]
);
$http->on('request',function($request,$response)
{
    $response->header("Content-Type","text/html;charset=utf-8");
    print_r($request->get);
    $response->cookie('Username',"FengQin",time()+1800);
    $response->end('<h1>Hello Swoole. #'.rand(1000,9999).'</h1> ssss'.json_encode($request->get));
});
$http->start();